package com.chilly.other.spring.listener;

import org.springframework.context.ApplicationListener;

/**
 * Java中的事件监听机制主要由事件源、事件对象、事件监听器三个部分组成。
 */
public class MailSendListener implements ApplicationListener<MailSendEvent> {
    @Override
    public void onApplicationEvent(MailSendEvent event) {
        MailSendEvent mse = (MailSendEvent) event;
        System.out.println("MailSendListener:向" + mse.getTo() + "发送完一封邮件");
    }
}
